Copyright: © 2000-2001 EC Software. All rights reserved.
Citation: This help file was made with Help & Manual. Download your own copy at www.helpandmanual.com!


Legal disclaimer and author contact
EHS - EC Software Help Suite

This help file was created with Help & Manual.

© 2000-2001 EC Software. All rights reserved.

Published 2001 in the European Union by EC Software.

Products that are referred to in this document may be either trademarks and/or registered trademarks of the respective owners. The publisher and the author make no claim to these trademarks.

While every precaution has been taken in the preparation of this document, the publisher and the author assume no responsibility for errors or omissions, or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it. In no event shall the publisher and the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or indirectly by this document.

The source code and sample programs in this package or parts hereof as well as the documentation shall not be redistributed without permission, explicit or implied, of the author.

Contact

E-mail:	support@ec-software.com

Home page:	http://www.ec-software.com


Introduction to EC Software Help Suite

When we released the first version of our tutorial All about help files in Borland Delphi in spring 2000, we tried to explain how to implement a full featured context sensitive help system as often seen in Microsoft applications: a right-click What's this? menu for every control, a What's this? button on the main form, mouse-driven context sensitive help for menus and all that.

While the description in the tutorial was a good start, it was unfortunately not that simple. Even worse, to make a useful context sensitive help system work, it has to be regarded by the application architecture, for it deeply interferes with every keyboard or mouse action the user takes. A professional help system is absolutely important to a real-world application but development time matters as well. So we thought of a workaround, a component that automates this task.

Result is EC Software Help Suite. While you develop great software with Delphi and we provide a great help authoring tool for the Delphi community, this component suite fills the gap of the implementation of the help system. It provides you with a ready-to-use solution for context sensitive help and lets you implement HTML HELP effortlessly.


Installation

Installation of the components (all Delphi versions)

Open one of the package files that fits your Delphi version, compile and install it:

ehs_d6.dpk	Delphi 6

ehs_d5.dpk	Delphi 5

ehs_d4.dpk	Delphi 4

ehs_d3.dpk	Delphi 3

Installation of the help file in Delphi 6

1	Copy the files EHS.hlp and EHS.cnt and EHS.als into the help directory of Delphi, for example (C:\program files\Borland\Delphi 6\help\).

2	Start Delphi, from the main menu choose Help | Customize...

The Delphi OpenHelp tool starts and opens the configuration file of Delphi's online help.

3	Select the Index tab.

4	Choose Edit | Add Files..., then locate and open EHS.hlp.

This will merge the keywords in EHS.HLP with the keyword index of Delphi's online help.

5	Select the Link tab.

6	Choose Edit | Add Files..., then locate and open again EHS.hlp.

This will enable context sensitive help for EC Software Help Suite.

7	Choose File | Save Project, then close the window.

Installation of the help file in Delphi 5

1	Copy the files EHS.hlp and EHS.cnt into the help directory of Delphi, for example (C:\program files\Borland\Delphi 5\help\) or place them in the same directory as the source files.

2	Start Delphi, from the main menu choose Help | Customize...

The Delphi OpenHelp tool starts and opens the configuration file of Delphi's online help.

3	Select the Index tab.

4	Choose Edit | Add Files..., then locate and open EHS.hlp.

This will merge the keywords in EHS.HLP with the keyword index of Delphi's online help.

5	Select the Link tab.

6	Choose Edit | Add Files..., then locate and open again EHS.hlp.

This will enable context sensitive help for EC Software Help Suite.

7	Choose File | Save Project, then close the window.

Installation of the help file in Delphi 4

1	Copy the files EHS.hlp and EHS.cnt into the help directory of Delphi, for example (C:\program files\Borland\Delphi 4\help\).

2	Open Delphi4.cfg with a text editor

3	In the 3rd-party section at the end of this file, add the following line:

:Link EHS.hlp

4	Delete the hidden file Delphi4.GID

Installation of the help file in Delphi 3

1	Copy the files EHS.hlp and EHS.cnt into the help directory of Delphi, for example (C:\program files\Borland\Delphi 3\help\).

2	Open Delphi3.cfg with a text editor

3	In the 3rd-party section at the end of this file, add the following line:

:Link EHS.hlp

4	Delete the hidden file Delphi3.GID


Where to start (component overview)

Here is an overview of the components contained in this suite. Each component can be used independently from the others.

 TWhatsThis

 key component

TWhatsThis is responsible for context sensitive help. It implements "What's this?" help as often seen in Microsoft programs. You usually drop one TWhatsThis component on your main form which automatically handles context sensitive help of the entire application.

 THelpRouter (formerly known as THTMLHelpRouter)

 key component

THelpRouter implements HTML HELP. While Delphi applications only support the Winhelp (.hlp) format, THelpRouter enables HTML HELP as well and automatically routes Delphi help calls to HTML HELP. You can switch between Winhelp and HTML HELP at run time, making your program even run on computers where the HTML HELP OCX is not installed.

This is the successor of former THTMLHelpRouter. The new version supports HTML HELP popup topics and lets you even take advantage of both worlds: Winhelp popup topics (with formatted text - not supported by HTML HELP) and HTML HELP standard topics.

 THelpContextMap

THelpContextMap saves a list of help context numbers and their associated topic IDs. The associations are stored in a compact sorted binary list with an extremely fast search function. TWhatsThis takes advantage of THelpContextMap, if assigned.

 TTrainingCard

Implements Winhelp training card help. Please refer to the description of training card help if your are not familiar with it. This component currently only works with Winhelp (.hlp) files. A HTML HELP version will probably follow in a later version.


History & Version Information

Version 1.23 (December 2001)

•	TWhatsThis did not correctly trap dropdown menus of floating tool bars. If a main menu was opened by a keyboard shortcut, the context sensitive help function did not work (D6 only).

Version 1.22 (November 2001)

•	THelpContextMap did not properly parse include files referenced by HPJ and HHP project files.

Version 1.21 (July 2001)

•	Invalid file reference in the Delphi 6 package fixed.

Version 1.20 (May 2001)

•	Support for Delphi 6 (VCL) added.

•	Bugfix for TWhatsThis: permanent help mode did not deactivate popup menus, so that the help window displayed in front of the application while the popup menu still remained active.

•	Improved TTrainingCard: the window handle that receives WM_TCARD messages gets only allocated when needed and deallocated as soon as the training card help file closed.

Version 1.11 (February 2001)

•	Bugfix for TWhatsThis (Application key on extended keyboards): the What's This? menu was displayed at the current mouse position and not in front of the control. With Delphi 4 and 5, control context menus were ignored, because TWhatsThis trapped the Application key when it was pressed, not when it was released. TWhatsThis also has a new option: wtUseAppKey.

Version 1.10 (January 2001)

•	Bugfix for THelpRouter: HTML HELP keyword search failed in some cases. THelpRouter also has a new property: CHMPopupTopics.

•	Demo application for TTrainingCard added

Version 1.01 (November 2000)

•	Bugfix for TWhatsThis in conjunction with THelpContextMap: TWhatsThis asked for the wrong topic ID in HTML HELP mode (the .htm extention must be omited).

Version 1.0 (October 2000)

•	First public release

Version 0.90 (May 2000)

•	Initial beta version


 TWhatsThis

Hierarchy	Properties	Methods	Events

Implements application-wide support for context sensitive help. Despite of the THelpRouter component, which is responsible for switching between Winhelp and HTML HELP, this is the key component of this collection.

Unit

ehsWhatsThis

Description

TWhatsThis simply does what it says: it implements application-wide "What's this?" help as often seen in Microsoft programs. It therefore completes the functionality of context sensitive help that Delphi is still missing.

•	It automatically implements a right-click "What's this?" menu. This popup menu is displayed dynamically. TWhatsThis recognizes controls that have their own popup menu and even regards manually displayed popup menus or popup windows.

•	The "What's this?" menu and further context sensitive help is available for all controls, even for disabled controls.

•	It implements a "What's this?" button and menu item for context sensitive help in the main form (and other forms that are not fixed-sized dialogs).

•	It implements mouse-directed context sensitive help for main menus and popup menus. When you right click a menu item, it's help topic gets displayed. (Delphi by default only provides context sensitive help in menus by pressing the F1 key.)

•	It gives you full control over the F1 key. You can make the F1 key display the table of contents, for instance.

•	It optionally displays a "No help available" system help topic if no help topic is available for a particular control. (Delphi default: does nothing.)

•	It gets you an OnGetContext event to assign help context numbers dynamically. This event can be used, for instance, to assign help context numbers for standard controls.

The Options property gives you full control over the behaviour of TWhatsThis.


Active
TWhatsThis.Active

TWhatsThis

Indicates whether or not an instance of TWhatsThis is active.

property Active: Boolean;

Description

Use the Active property to activate or deactivate an instance of TWhatsThis. Normally, there is only one instance of TWhatsThis in your application and this instance is always active. But there may be situations where you want to temporarily disable right-click help.

Note

If more than one instance of TWhatsThis is used in your application, only one instance can be active at a time. Activating a new instance of TWhatsThis automatically deactivates  the previous instance. When the new instance gets deactivated then, it automatically re-activates the previous instance.


F1Action
TWhatsThis.F1Action

TWhatsThis

Specifies the F1 key action.

property F1Action: TF1Action;

Description

F1Action defines the action that is taken when the user presses F1. While the default behaviour in Delphi is to display context sensitive help on F1, other applications such as MS Office 2000 display the table of contents when you press F1.

Although TWhatsThis tries to duplicate the outstanding help function of the MS Office suite, we found it useful to have a choice what happens when the user presses F1.

F1Action can have one of the following values:

Value	Meaning

goContext	Displays context sensitive help for the currently active control. This is the same function that the F1 key has in an application without TWhatsThis.

goDefault	Displays the default topic of the help file.

goTOC	Displays the table of contents of the help file.

Note

If you use TWhatsThis in conjunction with THelpRouter to implement HTML HELP, goDefault and goTOC are the same, for HTML HELP does not separate the table of contents from the topics.


HelpContextMap
TWhatsThis.HelpContextMap

TWhatsThis

Specifies an optionally associated help context map component.

property HelpContextMap: THelpContextMap;

Description

You can use a THelpContextMap to store help context numbers in your application instead of assigning help context numbers manually to controls. If assigned, TWhatsThis automatically asks the THelpContextMap component if it cannot find a help context number for a particular control.


Options
TWhatsThis.Options

TWhatsThis

The property Options specifies how TWhatsThis operates.

property Options: TWhatsThisOptions;

Description

Use the Options property to change the default behaviour of TWhatsThis.

Value	Meaning

wtDirectHelp	After a right mouse click, TWhatsThis usually displays a popup menu that, when clicked, displays the context sensitive help topic. If you include this option, no popup menu is displayed after a right mouse click. Instead, TWhatsThis immediately displays the help topic, if any.

wtMenuRightClick	Enables right-click context sensitive help for menu items. When the user right-clicks a menu item, TWhatsThis immediately displays the according context sensitive help topic.

wtNoContextHelp	Disables the so-called "no-help-topic". If no help context is found for a particular control, TWhatsThis can at least display a system help topic that informs the user that no help is available for this item. To avoid this, include this option.

wtNoContextMenu	Similar to wtNoContextHelp. It disables the display of the "What's This?" popup menu when no help is available for an item.

wtPopupOnForm	Enables right-click context sensitive help for forms. By default, when the user right-clicks the form canvas directly (no control beneath the mouse), no "What's This?" popup menu is displayed. To display the right-click popup menu even for forms, include this option.

wtInheritFormContext	Determines whether or not the help context number of the form is used, when no help context is specified for a control. By default, TWhatsThis iterates all parents of a control but the form to find a help context number, for the Form.HelpContext usually specifies a general introduction to a dialog box.

wtUseTag	Uses the Tag property of controls that do not have a HelpContext property. This means, you could use the Tag property of a TSpeedButton to specify a help context number for the button. However, if you use the Tag property otherwise, you must not include this option to avoide confusion.

wtUseAppKey	Displays the right-click popup menu when the user presses the Application key on extended keyboards.


PopupCaption
TWhatsThis.PopupCaption

TWhatsThis

Specifies the caption for the "What's this?" menu item of the right-click popup menu.

property PopupCaption: string;

Description

TWhatsThis automatically displays a popup menu that, when clicked, displays context sensitive help for the control clicked. PopupCaption specifies the caption of the only item of this popup menu.

In English, you would simply title it "What's this?".


PopupHelpContext
TWhatsThis.PopupHelpContext

TWhatsThis

Specifies the help context number for the "What's this?" menu item of the right-click popup menu.

property PopupHelpContext: THelpContext;

Description

TWhatsThis automatically displays a popup menu that, when clicked, displays context sensitive help for the control clicked. PopupHelpContext points to a help topic that explains this menu in your help file. This property is optional. If you do not assign a help context number, there is no explanation available for the "What's this?" popup menu.


WTMenuItem
TWhatsThis.WTMenuItem

TWhatsThis

Specifies the menu item that starts a temporary context sensitive help mode.

property WTMenuItem: TMenuItem;

Description

Use WTMenuItem (="What's This" menu item) to specify a Main menu item that initiates a temporary context senstive help mode. This context sensitive help mode is similar to a click of the question mark button in modal dialog forms.

The menu item automatically gets the short cut SHIFT + F1.

Fig 1: WTToolbarButton and WTMenuItem in Help & Manual


WTToolbarButton
TWhatsThis.WTToolbarButton

TWhatsThis

Specifies the toolbar button that starts a temporary context sensitive help mode.

property WTToolbarButton: TControl;

Description

Use WTToolbarButton (="What's This" toolbar button) to specify a button that initiates a temporary context senstive help mode. This context sensitive help mode is similar to a click of the question mark button in modal dialog forms.

Fig 1: WTToolbarButton and WTMenuItem in Help & Manual


TWhatsThis.CancelContextHelp

TWhatsThis

Cancels the temporary context sensitive help mode.

procedure CancelContextHelp;

Description

This method cancels the context sensitive help mode iniated by the ContextHelp method.

Note

You will not need to call this procedure manually since a click on WTMenuItem or WTToolbarButton manages the start and end of context sensitive help mode automatically.

See also

ContextHelp

OnEnterContextMode

OnLeaveContextMode


TWhatsThis.ContextHelp

TWhatsThis

Enters a temporary context sensitive help mode.

procedure ContextHelp;

Description

The context sensitive help mode is similar to the help mode that is initiated when you click on the questionmark button on the upper right edge of a dialog window.

The cursor changes to a questionmark/arrow and the user can retrieve context sensitive help by clicking any control.

Note

You will not need to call this procedure manually since a click on WTMenuItem or WTToolbarButton manages the start and end of context sensitive help mode automatically.

See also

CancelContextHelp

OnEnterContextMode

OnLeaveContextMode


TWhatsThis.OnEnterContextMode

TWhatsThis

Occurs when the component enters a temporary context sensitive help mode.

property OnEnterContextMode: TNotifyEvent;

Description

The OnEnterContextMode event is triggered when the user clicks WTMenuItem or WTToolbarButton to start context sensitive help mode, or when the ContextHelp method is called by the program.

You can use this event to update buttons or controls when the program enters context sensitive help mode.

See also

OnLeaveContextMode


TWhatsThis.OnF1Keydown

TWhatsThis

Occurs when the user presses F1.

property OnF1Keydown: TF1KeyDownEvent;

type

  TF1KeyDownEvent = procedure(Sender: TObject;

                              var CallHelp: Boolean)

                              of object;

Description

TWhatsThis captures the F1 key in any case. Normally, F1 leads to context sensitive help.

The Sender parameter is the TWhatsThis instance that is handling keyboard events. Use the CallHelp parameter to determine whether to execute the F1 key the normal way (as specified in TWhatsThis.F1Action) or to cancel the key.

If you want to provide a special help function on F1 not covered by TWhatsThis, set the CallHelp parameter to false and execute your own help function here.


TWhatsThis.OnGetContext

TWhatsThis	Example

Occurs when TWhatsThis tries to find a helpcontext number for the control the user requested help for.

property OnGetContext: TWTHelpContextEvent;

type

  TWTHelpContextEvent = procedure(Sender: TObject;

                                  HelpItem: TObject;

                                  IsMenu: Boolean;

                                  var HContext: THelpContext)

                                  of object;

Description

This event is fired when TWhatsThis tries to find a help context number for the item the user requested help for. This even occurs before the OnPopup event and before the OnHelp event. Use this event to assign or change help context numbers on the fly.

Parameter	Meaning

Sender	The instance of TWhatsThis that is in charge.

HelpItem 	The control or menu item the user requested help for.

IsMenu	Determines the meaning of HelpItem. If true, HelpItem points to a TMenuItem. If false, HelpItem points to a TControl.

HContext 	Contains the help context number found. This is either the help context number of HelpItem (if appropriate) or the inherited help context number of one of HelpItem's parents.


TWhatsThis.OnHelp

TWhatsThis

Occurs when TWhatsThis displays a context sensitive help topic.

property OnHelp: TWTHelpEvent;

type

  TWTHelpEvent = procedure(Sender: TObject;

                           HelpItem: TObject;

                           IsMenu: Boolean;

                           HContext: THelpContext;

                           X, Y: integer;

                           var CallHelp: boolean)

                           of object;

Description

This event is fired before TWhatsThis actually displays a context sensitive help topic. You can use this event to determine whether the help call is executed or not.

Parameter	Meaning

Sender	The instance of TWhatsThis that is in charge.

HelpItem 	The control or menu item the user requested help for.

IsMenu	Determines the meaning of HelpItem. If true, HelpItem points to a TMenuItem. If false, HelpItem points to a TControl.

HContext 	The help context number of the context sensitive help topic.

X, Y	The position, in screen coordinates, where to position the context sensitive help popup window.

CallHelp 	Is true by default. If you want to cancel the help call set this parameter to false.


TWhatsThis.OnLeaveContextMode

TWhatsThis

Occurs when the component leaves the temporary context sensitive help mode.

property OnLeaveContextMode: TNotifyEvent;

Description

The OnLeaveContextMode event is triggered when the temporary context sensitive help mode initiated by WTMenuItem or WTToolbarButton ends. There is no information in this event whether the context help mode was cancelled or successfully completed.

You can use this event to update buttons or controls when the program leaves context sensitive help mode.

See also

OnEnterContextMode


TWhatsThis.OnPopup

TWhatsThis

Occurs when TWhatsThis displays the right-click "What's this?" context menu.

property OnPopup: TWTPopupEvent;

type

  TWTPopupEvent = procedure(Sender: TObject;

                            HelpItem: TObject;

                            HContext: THelpcontext;

                            X, Y: integer;

                            var DoPopup: boolean)

                            of object;

Description

This event is fired before TWhatsThis displays the right-click context menu. You can use this event to determine whether the context menu should pop up or not.

Parameter	Meaning

Sender	The instance of TWhatsThis that is in charge.

HelpItem 	The control the user requested help for (Note: the right-click popup menu only appears when the user right-clicks a TControl. In menus, the OnHelp event appears immediately because there is no context popup menu in menus).

HContext 	The help context number of the context sensitive help topic.

X, Y	The position, in screen coordinates, where to position the context sensitive help popup window.

DoPopup 	Is true by default. If you want to cancel the context menu, set this parameter to false.


 THelpRouter

Hierarchy	Properties	Methods	Events

Implements application-wide support for HTML HELP.

Unit

ehsHelpRouter

Description

THelpRouter routes the help calls of your application automatically to Winhelp or - if installed - HTML HELP. All application.helpcommand(command, data) calls are trapped and re-routed if HTML HELP is installed. The only thing you have to do is to supply a HTML HELP file with your application, that has the same name as the Winhelp file except the extention is ".chm".


THelpRouter.CHMPopupTopics
THelpRouter.HelpFile

THelpRouter

Specifies an optional file that contains HTML HELP popup topics in text format. This file is not an external file but part of the internal file system of the .CHM (HTML HELP) file.

property CHMPopupTopics: string;

Description

This property tells the help router where HTML HELP popup topics are located. HTML POPUP topics are plain text and the file that contains the topics is compiled right into the .CHM file.

The name of this file is by default "CSHelp.txt", as recommended by Microsoft. Help & Manual creates this file automatically, if you enable HTML HELP popups.

If your help authoring tool uses another file name to store HTML HELP popup topics, specify the file name here.


THelpRouter.HelpFile

THelpRouter

Specifies an optional help file.

property HelpFile: string;

Description

This property overloads the default value for Helpfile. To determine, which help file to call, the router checks the following values:

1	Application.helpfile

2	If available and assigned: Currentform.helpfile

3	If assigned: HTMLHelpRouter.helpfile

Note:

The extention of the help file is always changed by the help router if necessary. For instance, if HelpType is htHTMLHelp, the given file name is always changed to a ".chm" extention.


THelpRouter.HelpType

THelpRouter

Specifies the help format.

property HelpType: THelpType;

Description

HelpType determines whether calls are routed to Winhelp or HTMLhelp. It can be one of the following values:

Value	Meaning

htWinhelp	Displays help in Winhelp (.HLP) format. (In case you only use the Winhelp format without alternatively HTML HELP, you do not need the THelpRouter component).

htHTMLhelp	Displays help in HTML HELP (.CHM) format. Both - normal topics displayed in the HTML HELP viewer and popup topics must be in HTML HELP format.

htMixedMode	Displays context sensitive help (popup topics) in Winhelp format, all other help calls are routed to HTML HELP. It is presumed that there are two help files with the same name but a different extention: .HLP for popup topics and .CHM for the rest.

Note

THelpRouter automatically changes the extention of Application.HelpFile to .HLP or .CHM as necessary.


THelpRouter.HTMLHelpInstalled

THelpRouter

Indicates whether or not the HTML HELP OCX control can be loaded.

procedure HTMLHelpInstalled: Boolean;

Description

Use the HTMLHelpInstalled method to check whether the computer your application is running on supports HTML HELP. THelpRouter checks this internally before calls to HTML HELP are executed.


THelpRouter.ShowType

THelpRouter

Specifies how context sensitive help is displayed.

property ShowType: TShowType;

Description

ShowType determines whether context sensitive help is displayed in a popup window or in the main window of the help viewer.

Value	Meaning

stDefault	Uses the form default. This option is set in Form.BorderIcons. If biHelp is included, the topic will appear in a popup window. If not, a normal help window is shown. This option is active although the [?]-button does not appear in the title bar, when the biMaximize and biMinimize-buttons are included.

stMain	Always show a normal (mostly the "Main") window. This option enables you to use normal help windows for context sensitive help, even if the form has a [?]-button on the title bar (e.g. in dialog boxes).

stPopup	Always show help in a popup window. This option is not supported by THTMLHelpRouter with HTML HELP.


THelpRouter.HelpALink

THelpRouter

Executes a help jump on A-keywords.

function HelpALink(keyword: string): Boolean;

Description

A-keywords are keywords that are not visible to the user of your help file. They are used for inter-file links, like in the Delphi online help.

Return value

If the help call succeds, the function returns True.

See also:

HelpKLink


THelpRouter.HelpContent

THelpRouter

Displays the table of contents of your help file.

function HelpContents: Boolean;

Description

This method simplifies the display of the table of contents of your help file. It does not only open the Table-of-contents window, but also ensures that the Table-of-contents tab is displayed to the user.

Return value

If the help call succeds, the function returns True.


THelpRouter.HelpJump

THelpRouter

Displays a specific topic in the main window of the help viewer.

function HelpJump(helpfile, topicid: string): Boolean;

Description

This function is similar to Application.HelpJump but works with both formats - Winhelp (.hlp) and HTML HELP (.chm).

Return value

If the help call succeds, the function returns True.


THelpRouter.HelpKeyword

THelpRouter

Displays the keyword index of the help file.

function HelpKeyword(keyword: string): Boolean;

Description

This function is similar to HelpContent but displays the keyword index tab instead of the table of contents.

The keyword parameter specifies the keyword to find. If a matching keyword exists, it becomes selected when the keyword index is displayed. If not, the nearest keyword becomes selected.

To open the keyword index at its beginning, specify a blank string as the keyword parameter.

Return value

If the help call succeds, the function returns True.

See also:

HelpContent

HelpKLink


THelpRouter.HelpKLink

THelpRouter

Executes a direct keyword search.

function HelpKLink(keyword: string): Boolean;

Description

This function is almost the same as HelpKeyword. While HelpKeyword opens the index tab of the help file and locates the nearest matching keyword, HelpKLink directly jumps the the topic without displaying the keyword index.

Return value

If the help call succeds, the function returns True.

See also:

HelpALink

HelpKeyword


THelpRouter.HelpPopup

THelpRouter

Displays a HTML HELP popup topic with the specified text or displays the HTML HELP popup topic specified by the HelpContext parameter.

function HelpPopup(X, Y: integer; HelpContext: integer; Text: string): Boolean;

Description

This function works only with HTMLhelp. If HTMLhelp is not installed (can be checked with HTMLhelpInstalled), the return value is false. The X- and Y-value define the upper middle position of the popup window. Both values are in screen coordinates.

If Text is not empty, the function displays the given text at the given position.

If Text is empty, the function displays the HTML HELP popup topic retrieved by the HelpContext number.

Return value

If the help call succeds, the function returns True.


THelpRouter.OnHelp

THelpRouter

This event is triggered when THelpRouter receives a help call.

property OnHelp: THelpEvent;

Description

This event occours before the router actually executes the help call. You can use this event to change the help router properties for the current situation or to prevent the router from executing the help call at all. The parameter CallHelp is true by default - if you set it to false in the event, the execution of the help call is terminated so that you can handle it on your own.


 THelpContextMap

Hierarchy	Properties	Methods

Implements a container to store help context numbers.

Unit

ehsContextMap

Description

THelpContextMap is an add-on component that lets you store help context numbers and their associated topic IDs. Rather than assigning help context numbers to controls manually in the Delphi IDE, you can store help context numbers in this container object and get read on the fly.

This is especially useful, when you implement dynamic controls or forms.

The help context list is stored as a sorted list using hash numbers. The benefit is that the list is small (each pair of topic ID / help context number requires 16 bytes) and extremly fast.

THelpContextMap reads a .HPJ (Winhelp project) file or a .HHP (HTML HELP project) file directly. It analyzes the [MAP] section that contains the topic ID / help context associations and stores it at design time.

At runtime, you can retrieve a help context number with the GetContext function.

Cooperation between TWhatsThis and THelpContextMap

TWhatsThis takes advantage of THelpContextMap. If assigned, it searches the list for a topic ID containing the name of the control if a particular control does not have a help context number. In this case, topic IDs are expected to have the following syntax.

Winhelp syntax (for .HPJ files):

Formname.Controlname, where Formname is the name of the parent form and Controlname is the name of the control the help topic is for. The image below illustrates how the topic IDs must be defined in the .HPJ file:

HTML HELP syntax (for .HHP files):

Formname_Controlname, where Formname is the name of the parent form and Controlname is the name of the control the help topic is for. The image below illustrates how the topic IDs must be defined in the .HHP file:


THelpContextMap.FileName

THelpContextMap

Specifies the name of a help project file.

property FileName: string;

Description

Specifies the name of the help project file. This can either be a Winhelp project file (.HPJ) or a HTML HELP project file (.HHP).

When you update this property, THelpContextMap immediately parses the project file and analyzes the [MAP] section in this file (subsequent includes are recognized). This list of topic IDs and their associated help context numbers is then stored in a binary format inside the component.

You use the GetContext method to retrieve a help context number for a topic ID at runtime.


THelpContextMap.GetContext

THelpContextMap

Retrieves a help context number for a given topic ID.

function GetContext(TopicID: string): THelpContext;

Description

You call this function to get a help THelpContext from a known topic ID.

Example:

HC := HelpContextMap1.GetContext('MainForm.Speedbutton_Save');


 TTrainingCard

Hierarchy	Properties	Methods	Events

Implements training card help.

Unit

ehsTrainingCard

Description

When you have written the training card help file, assign the name of this help file to the HelpFile property of the component.

To start a set of training cards, use one of the help methods of TTrainingCard.

Use HelpContext to display a training card topic by its help context number or HelpJump, to display a training card topic by its alphanumeric topic ID.

The HelpCommand method finally provides you with the full functionality of all possible WinHelp calls.

Note

WinHelp creates an extra help file instance for training cards only. To address the correct instance of your help file, it is required to use the help methods of the component only and not the help methods of TApplication.


TTrainingCard.HelpFile

TTrainingCard	See also

Specifies the name of the training card help file.

property HelpFile: string;

Description

Use HelpFile to specify the help file that contains training card topics. This property is required to start a training card.

The component does not inherit and use Application.HelpFile or Form.HelpFile. If your training card topics are located in the main help file of your application, specify the name of that help file here again.


TTrainingCard.IsActive

TTrainingCard

Indicates whether a training card is currently displayed or not.

property IsActive: Boolean;

Description

IsActive is True while a training card is displayed and False if it is not. IsActive is set to True when you make a training card help call.

Note

IsActive is read-only.


TTrainingCard.Close

TTrainingCard	See also

Closes the training card that is currently open.

procedure Close;

Description

Use Close to cancel training card help mode. For instance, if the dialog  that has invoked a training card gets closed, close the training card help window as well.

Note

Closing the training card programmatically does not trigger the OnClose event. This event, on the contrary is triggered when the user closes the training card help window.


TTrainingCard.HelpCommand

TTrainingCard	See also

Provides quick access to any of the Help commands in the WinHelp API (application programming interface).

function HelpCommand(Command: Word; Data: Longint): Boolean;

Description

Use HelpCommand to send a training card command to WinHelp. Although this command is identical, you can not use Application.HelpCommand instead. WinHelp creates a second help instance for training cards only and it is therefore required to address the correct instance. This is ensured by this command and by TTrainingCard.HelpContext as well as TTrainingCard.HelpJump.


TTrainingCard.HelpContext

TTrainingCard	See also

Displays a specific training card help topic by help context number.

function HelpContext(Context: THelpContext): Boolean;

Description

Use HelpContext to bring up the training card help topic specified by the Context parameter from the file specified in the HelpFile property. HelpContext returns true if the help call succeeds.

Example:

TrainingCard1.HelpContext(1001);


TTrainingCard.HelpJump

TTrainingCard	See also

Displays a specific training card help topic by topic ID.

function HelpJump(const JumpID: string): Boolean;

Description

Call HelpJump to bring up a training card help topic identified by its symbolic name. HelpJump displays the training card topic identified by the JumpID parameter from the file specified in the HelpFile property. HelpJump returns true if the help call succeeds.

Example:

TrainingCard1.HelpJump('dialog_topic2');


TTrainingCard.OnButton

 TTrainingCard

Occurs when the user presses an authorable button. The Button parameter contains the ID of the button, sent by the TCard() macro.

property OnButton: TTrainingCardButtonEvent;

type

  TTrainingCardButtonEvent = procedure(Sender: TObject;

                                       Button: Word)

                                       of object;

Description

Write an OnButton event handler to respond, when the user clicks an authorable button of the training card topic.

The Sender parameter is the TTrainingCard instance whose handler is called. The Button parameter is the button ID specified in the TCarc() macro of the training card help file.


TTrainingCard.OnCardData

 TTrainingCard

Occurs when numeric data has been sent by the training card. The data parameter is the integer value sent by the TCard() macro.

property OnCardData: TTrainingCardDataEvent;

type

  TTrainingCardDataEvent = procedure(Sender: TObject;

                                     Data: Integer)

                                     of object;

Description

Write an OnCardData event handler to respond, when the user clicks a hotspot that executes a TCard() macro with a numeric value.

The Sender parameter is the TTrainingCard instance whose handler is called. The Data parameter is the numeric value specified in the TCarc() macro of the training card help file.


TTrainingCard.OnClose

 TTrainingCard

Occurs when the user has closes the training card help window.

property OnClose: TNotifyEvent;

Description

Write an OnClose event handler to perform any special processing that should occur when the user has cancelled the training card mode.


TTrainingCard.OnOtherCaller

 TTrainingCard

Occurs when another application or another TTrainingCard component requests training card help.

property OnOtherCaller: TNotifyEvent;

Description

Write an OnOtherCaller event handler to perform any special processing that should occur immediately when another training card becomes active.

Winhelp can only handle one training card at a time. In case another training card is opened anywhere on the system, the first training card gets closed automatically. This event is similiar to the OnClose event.


What is context sensitive help?

Context sensitive help (also called contextual help) provides immediate assistance to users without their having to leave the context in which they are working. It provides information about a particular object and its context. It answers questions such as "What is this?" and "Why would I use it?" Some of the basic ways to support contextual user assistance in your application include:

•	Context sensitive Winhelp topics

•	Tool tips

•	Status bar messages

•	Help command buttons

When we say context sensitive help in this document, we mean Winhelp files and context help topics.

Winhelp supports a special help mode for context sensitive help using popup help windows. A popup help topic is usually very short and gives a brief explanation for a particular control. When the user clicks on the popup window or anywhere else, it automatically disappears.

Context sensitive help topic displayed in a popup window


How context sensitive help can be accessed

You can support user access to context sensitive help topics by including the following in your application:

1)	A What's this? command from the Help drop-down menu on the main window and a What's this? button on a toolbar

Both commands start up a temporary, context sensitive help mode. The main form gets disabled, the cursor changes to a questionmark pointer and when you click on any control in the main form, a context sensitive help topics appears in a popup window.

2)	A What's this? button on the title bar of a dialog window

Works like (1) in dialog windows that do not have a menu bar and a tool bar. When the user clicks on the questionmark button, the cursor changes to a questionmark pointer and when you click on any control in the main form, a context sensitive help topics appears in a popup window.

This function is implemented by Delphi, you don't have to code this manually.

3)	A What's this? command on the shortcut menu for a specific object

When the user right-clicks a control, a popup menu appears displaying at least the item "What's this?". To get this question answered, the user chooses this menu item and a context sensitive help topic appears in a popup window, explaining the control or function.

4)	Support for the What's this? shortcut key when a control has the input focus

This is the F1 key and is implemented by Delphi, you don't have to code this manually. When the user presses F1 while a control has the focus, a context sensitive help topics appears, explaining that control.

5)	Support for the What's this? mode shortcut key

This is SHIFT + F1. This function is slightly different to (4). It does not immediately display a help window but changes to context sensitive help mode described in (1).


How context sensitive help works

The Winhelp API provides functions to display context sensitive help using so-called help context numbers. Unlike hyperlinks in help files which refer to another topic by its alphanumeric topic ID, displaying context sensitive help requires a numeric ID.

You will already have recognized this property: every TWinControl descendant has a HelpContext property, which is an integer value.

HelpContext property in the Object Inspector

These help context numbers are not automatically assigned. You have to invent these numbers by yourself and to make sure that the help context numbers assigned to controls and their appropriate topics match. That's annoying work that help authoring tools can handle automatically, but more on that later.

Help context numbers must be unique throughout a project. You can assign the same help context numbers to more than one control - meaning that these controls share the same help topic. But you cannot assign the same help context number to more than one help topic, because the context number is a unique identifier.

Controls inherit help context numbers

If a control in your application has no help context assigned (HelpContext property is zero), the HelpContext of its parent control is used, up to form level. This allows you, for example, to explain a button group in a single help topic. If the form does not have a help context number, no context sensitive help is displayed.

Let's summarize.

To enable context sensitive help

1	You must tell your application that is has a help file at all. This is necessary to enable any help function in a Delphi application.

2	You must invent and assign unique integer numbers to all topics of your help file that should be accessed as context sensitive help.

3	You must assign these integer numbers to the forms and controls of your Delphi project to tie context sensitive help topics and the controls they describe together. Since controls inherit the help context from their parents, not every single control has to have a help context number. But at least every form has.


Preparing a help file for context sensitive help

To prepare a help file for context sensitive help, you must assign numeric values - help context numbers - to all topics that you want to make available for context sensitive help. A help project provides a so-called [MAP] section that stores the numeric help context numbers and the mapped alphanumeric topic IDs.

Unless you are using a help authoring tool that does this for you, you have to invent the help context numbers by yourself and these numbers quickly get confused and will be hard to keep track of, especially when you have to update your help files later.

So it's a good idea to organize help context numbers into sections. Here are a few questions you should ask yourself before you start:

How many forms does your Delphi project have?

Reserve a group of help context numbers for each form. For example, start with 100000 for the main form and continue with 101000 or 110000 for each secondary form.

Which of the forms are difficult to understand?

While a group of navigation buttons could be described by one topic, consider to provide a separate help topic for controls that are not so obvious. If a function in your application is not used daily but nevertheless important (e.g. a mail merge dialog), provide more, and detailed help for it.

How many context topics will you need in total?

Try to estimate the number of context sensitive help topics for each form.

Make screen shots of your forms and print them, before you start. Mark the controls you plan to provide a help topic for.

Write context sensitive help one form after another

Write all help topics required for one form. Help topics don't have to be finished at this time, a raw draft of a topic is sufficient.

Map the alphanumeric topic IDs to context numbers.

Assign the help context numbers to your controls in the Delphi IDE.

Compile the help file and test it.

Then carry on with the next form.

When you have written the context sensitive help topics, you are ready to assign help context numbers to them.

To add help context numbers to your help file

1	Open your help project with Microsoft Help Workshop.

2	Click the Map button.

The Map topic IDs dialog is displayed.

3	Choose Add, to add a new entry. Specify the alphanumeric topic ID and its matching help context number.

4	Repeat (3) until all context help topics of your help file have a matching context number. Then compile your help file and test it.

Map topic IDs dialog box of the Microsoft Help Workshop


Preparing the Delphi application

Context sensitive help must be supported by the help file and by the application. The second step of implementation is to prepare the Delphi application.

First, we have to tell the application that it has a help file at all. This step is described here.

Second, we must assign the help topics resp. their associated help context numbers to the controls they explain.

To assign a help context number to a control

1	Select the control in the Delphi IDE

2	Switch to the Object Inspector and locate the property HelpContext

3	Assign the help context number you have assigned to the appropriate help topic before.

Help context property in the Object Inspector

Not all controls have a HelpContext property

The HelpContext property is available for the following controls:

•	Controls that are a descendant of TWinControl. These controls have a window handle and can receive the input focus. For example: TEdit, TMemo, TButton, TListbox, TComboBox, TPanel and so on. Unfortunately, the popular TSpeedButton class does not declare a HelpContext property. To provide context sensitive help for a speedbutton, you rely on enhanced third-party controls of this class (see below).

•	Menus, popup menus and menu items.

•	Enhanced third-party controls that implement the HelpContext property like the Toolbar97 components from Jordan Russell (http://www.jordanr.dhs.org/) and others.


What is training card help?

"Training cards are a set of Help topics in secondary windows that you can configure to send instructions to and receive instructions from another program. This is particularly useful in walking users through a procedure step by step." (from HCW.HLP)

If you have never heard about training card help, you are not the only one. This is a feature of Winhelp 4.0, introduced with Windows 95. However, except Microsoft, nobody seems to use it. And that's a mistake, for this feature is very useful.

Training card help is like a wizard in help file format

Frankly speaking, a training card is a brief help topic with bla bla text. From the technical point of view, the key feature of the topic is that it includes one or more hotspots that execute a Winhelp macro, a TCard() macro.

It works if fact extremely simple. The TCard() macro takes an integer parameter and when it is executed by the user, Winhelp sends a message to the program that has invoked the help topic. The message sent to the program is WM_TCARD and carries the integer value from the TCard() macro. To bring that thing to life, the application must react on this message. And that's the tricky part - or better - a lot of work.


What training cards can be used for

The interactive nature of training card help requires a tight cooperation between programmer and help author. The programmer has to do the bigger part of the work. If you are a help author, read ahead. If you are the programmer, better switch to the next chapter ;-)

Imagine you want to tell the user how to open a specific dialog, select a certain option and save the changes by clicking OK.

•	A context sensitive help topic would describe the meaning of the particular option.

•	A procedure topic would describe the process of opening the dialog, selecting the option and closing the dialog.

•	A training card topic would describe the process and show it step by step, performing real action.

An advanced user would rather read the procedure topic or not even that, if context sensitive help explains the option clearly enough. He would be bored by getting explained how to select an option. So, training cards are for beginners only? Not necessarily.

Think of a mail merge dialog, that consists of several steps like selecting the document, inserting field variables into it, choosing a customer database, selecting several entries from the database, and so on.

A training card is like a wizard. But where a wizard only talks of a "database", the training card topic can easily provide an additional popup topic that explains this term. In case the user does not know what a database is, he would refer to it. If he is familiar with databases, he isn't bothered.


Preparing a training card help file

Training card help only makes sense within the context it explains. You must not let the user refer to a training card unintentionally. On the other hand, while a training card is active the help window should not allow to break out of this context, except for closing the training card and cancelling the process. The latter is very important, because when a step-by-step procedure is initiated by a training card, the application might expect a certain command. For instance "next step A" or "next step B" or "Cancel".

Also, training card help is always a separate task - from the technical point of view. When the help file of your applicatication is already displayed and you invoke another topic, the topic is displayed in the same help window or in a secondary help window of the same instance of your help file. Training card help, on the contrary, is a separate task - Winhelp creates a new help file instance that handles only training card help.

So, if you let the user break out of the training card context, for instance to display the table of contents and then to refer to another topic, you might see two instances of your help file. A little bit confusing for the user.

Use a separate help file for training card topics

A training card help file is nothing special - it is simply a help file. It is, however, a very good idea to separate training cards from the rest of your online help. Here is why:

•	Placing all training card topics in a separate help file helps you to keep track of them.

•	A training card help file neither has a table of contents nor a keyword index. Although it could, that did not make sense. A training card always belongs to a certain context - there is nothing to browse or search for. So, the training card help file only consists of a .HLP without an accompanying .CNT.

•	It can use more help windows than only one. But it is simplier to handle if all topics display in the same help window and the size and position of that window gets adjusted at run time.

•	Remove all buttons from the help windows, including the "Main" window. The help window a training card is displayed in should not provide any additional options, such as a print or search button. Keep in mind that when a user invokes training card help, he might feel unsecure what to do in that situation. Remove everything that can distract him from the current issue. In this case, less is more.

Writing training card topics

A training card typically consists of a set of help topics. While a set of topics often can be browsed, a training card topic would notify the application instead, when the user wants to switch to the next topic. This allows the application to act and to synchronize the content of the training card with the application.

This notification of the application is done by the Winhelp macro TCard(). This macro takes one integer parameter that is transmitted to the application.


The steps of a training card session

It is essential for training card help that you understand the whole process of a training card session. To illustrate that, here is an example of such a session.

The application initiates training card mode by calling

TrainingCard1.HelpContext(1);

Winhelp creates a new help instance for the training card and displays the topic with the context number 1.

The training card topic gives a brief explanation of the dialog and provides two options to choose from. Both options are represented in the help topic by a hot spot that execute a macro.

Hot spot for Option 1:  executes the macro "TCard(101)"

Hot spot for Option 2:  executes the macro "TCard(102)"

The user clicks Option 1.

The application gets notified of this action. It is sent a WM_TCARD message containing the data parameter 101, which is triggered in the TTrainingCard.OnCardData event. The application has to perform an action according to Option 1 of the training card topic.

Depending on the result of the action (it could have failed), it calls the next training card topic by calling

TrainingCard1.HelpContext(2);

The training card topic with the context number 2 continues the procedure, provides more explanation of the choosen Option 1 and tells the user what happens next.

This is cycle could be continued. Let's assume that our procedure is about to be finished at this point, and the training card provides only two options - to click OK and perform the final action, or to click Cancel to cancel the whole procedure. (IDOK and IDCANCEL are predefined integer contants, described here.)

Hot spot for OK:	executes the macro "TCard(IDOK)"

Hot spot for Cancel:	executes the macro "TCard(IDCANCEL)"

The user clicks OK.

The application receives a WM_TCARD message containing the parameter IDOK, which is triggered in TTrainingCard.OnButton. The Button parameter of this event contains the ID. The application now performs the desired action and then closes the training card with:

TrainingCard1.Close;

Note:

If the user had clicked Cancel, the data parameter submitted to the application would have been IDCANCEL.

If the user had closed the training card help window at any time, the application would have received a WM_TCARD message with the IDCLOSE parameter. This message would have been triggered in TTrainingCard.OnClose.


The TCard() macro

The TCard() macro sends a message to the program that is invoking WinHelp as a training card. The macro takes only one parameter but comes in three flavors, depending on that parameter. Here is the description from HCW.HLP:

Parameter is a numeric value

Example:	TCard(1001)

Description:	If a numeric value is used, the training card program is sent HELP_TCARD_DATA (16) for the wParam parameter, and the numeric value is passed as the lParam value of the WM_TCARD message.

Parameter is one of 9 predefined constants

Example:	TCard(IDCANCEL)

Description:	Sends a WM_TCARD message to the application with the given constant for the wParam value. The lParam value is zero. The constants are defined as follows:

IDOK (1)	The user clicked an authorable OK button.

IDCANCEL (2)	The user clicked an authorable Cancel button.

IDABORT (3)	The user clicked an authorable Abort button.

IDRETRY (4)	The user clicked an authorable Retry button.

IDIGNORE (5)	The user clicked an authorable Ignore button.

IDYES (6)	The user clicked an authorable Yes button.

IDNO (7)	The user clicked an authorable No button.

IDCLOSE (8)	The user closed the training card.

Note: the application retrieves a WM_TCARD message with wParam = IDCLOSE when the user closes the training card manually. Do not use this value as part of a TCard macro.

IDHELP (9)	The user clicked an authorable Help button.

Parameter is a topic ID

Example:	TCard(MyNextTopic)

Description:	If a topic ID is used, the ID is mapped to the numeric value found in the project file and it is passed to the program.

What are authorable buttons?

While the usage of numeric values may be relatively clear, you might ask: "What is an authorable button?". This is simply a button that you place in your training card help topic using the button command. The example in the figure below creates a button with the caption "Yes", and a bitmap that is used as a hot spot. Both perform the macro TCard(IDYES).

You could use any numeric value to indicate "Yes" as well. The 9 predefined constants are just for convenience - and to distinct between numerical data and a common Yes/No/Cancel user reply. It entirely depends on your application, what happens on which parameter.


Preparing the application

To prepare your application for training card help, drop a TTrainingCard component on your form. You can use as many TTrainingCard components as you like but since Winhelp can display only one training card at a time, you might use just one instance of this component for all purposes.

The tricky part is to react on the training card events. Write a handler for the OnCardData and the OnClose event. If you want to use authorable buttons, write a handler for the OnButton event as well.

What happens when such an event occurs is on you resp. on the application. A tight cooperation between help author and programmer is required to accomplish a set of training cards that make sense. While this is a lot of work, it is fun as well.


All about help files in Borland Delphi

All about help files in Borland Delphi is a comprehensive tutorial that shows all aspects of implementing a help file in a Delphi application.

Click here [image] to download this free tutorial at

http://www.ec-software.com.


Using Help & Manual to create help files easily

Help & Manual® is a stand-alone and true WYSIWYG authoring tool that simplifies the creation of Windows help files, print manuals and documentation in general.

A straight-forward and easy-to-use interface

Help & Manual combines a text editor and a tree-view of the content in one window. It lets you easily navigate the table of contents and insert or edit help topics without much fuss. This simple and intuitive interface has been much copied but never reached the same usability level.

The WYSIWYG interface leaves out all the cryptic references for hyperlinks, macros and images. Instead of scuffling with topic IDs, footnotes and obscure commands, you can concentrate on more important things: to design your help file.

Everything you need is right there at your finger tips.

With Help & Manual you can easily create Windows help files (for Windows 3.x, Windows 95 / NT and the new format HTML HELP) as well as electronic documentation (HTML pages, richtext files to ship an electronic manual).

Last but not least, you can print user manuals directly. Including a table of contents and a keyword index, with customized page layouts, headers, footers and page numbering.

All these documentation types are created from one single source! From a Help & Manual project that saves the data for topics, contents, keywords, index and all project settings in a single source file.

Click here [image] to download a free evaluation copy of Help & Manual at

http://www.ec-software.com.


This information is not available.

The reason could either be that this property is not defined in the Delphi version you use or that you have opened this help file outside the Delphi IDE. Information on inherited properties can only be requested inside the Delphi IDE.


Scope

  Protected

  Published

Accessibility

  Read-only


Hierarchy

TObject

TPersistent

TComponent


Derived from TComponent

ComObject

ComponentCount

 	ComponentIndex

Components

ComponentState

ComponentStyle

Name

 	DesignInfo

Owner

Tag

 	VCLComObject


Derived from TComponent

 	BeforeDestruction

 	Destroy

 	DestroyComponents

 	Destroying

 	ExecuteAction

 	FindComponent

 	FreeNotification

 	FreeOnRelease

 	GetNamePath

 	GetParentComponent

 	HasParent

 	InsertComponent

 	RemoveComponent

 	SafeCallException

Derived from TPersistant

 	Assign

Derived from TObject

 	AfterConstruction

 	ClassInfo

 	ClassName

 	ClassNameIs

 	ClassParent

 	ClassType

 	CleanupInstance

 	DefaultHandler

 	Dispatch

 	FieldAddress

 	Free

 	FreeInstance

 	GetInterface

 	GetInterfaceEntry

 	GetInterfaceTable

 	InheritsFrom

 	InitInstance

 	InstanceSize

 	MethodAddress

 	MethodName

 	NewInstance


TTrainingCard_Properties
TTrainingCard properties

TTrainingCard	Legend

In TTrainingCard

HelpFile

IsActive

Derived from TComponent

ComObject

ComponentCount

 	ComponentIndex

Components

ComponentState

 	ComponentStyle

 	Name

 	DesignInfo

Owner

 	Tag

 	VCLComObject


TTrainingCard_Methods
TTrainingCard methods

TTrainingCard	Legend

In TTrainingCard

 	Close

 	HelpCommand

 	HelpContext

 	HelpJump

Derived from TComponent

 	BeforeDestruction

 	Destroy

 	DestroyComponents

 	Destroying

 	ExecuteAction

 	FindComponent

 	FreeNotification

 	FreeOnRelease

 	GetNamePath

 	GetParentComponent

 	HasParent

 	InsertComponent

 	RemoveComponent

 	SafeCallException

Derived from TPersistant

 	Assign

Derived from TObject

 	AfterConstruction

 	ClassInfo

 	ClassName

 	ClassNameIs

 	ClassParent

 	ClassType

 	CleanupInstance

 	DefaultHandler

 	Dispatch

 	FieldAddress

 	Free

 	FreeInstance

 	GetInterface

 	GetInterfaceEntry

 	GetInterfaceTable

 	InheritsFrom

 	InitInstance

 	InstanceSize

 	MethodAddress

 	MethodName

 	NewInstance


TTrainingCard_Events
TTrainingCard events

TTrainingCard	Legend

In TTrainingCard

OnButton

OnCardData

OnClose

OnOtherCaller


TWhatsThis_Properties
TWhatsThis properties

TWhatsthis	Legend

In TWhatsThis

Active

F1Action

HelpContextMap

Options

PopupCaption

PopupHelpContext

WTMenuItem

WTToolbarButton

Derived from TComponent

 	ComObject

 	ComponentCount

 	ComponentIndex

 	Components

ComponentState

ComponentStyle

Name

 	DesignInfo

Owner

Tag

 	VCLComObject


TWhatsThis_Methods
TWhatsThis methods

TWhatsthis	Legend

In TWhatThis

 	CancelContextHelp

 	ContextHelp

Derived from TComponent

 BeforeDestruction

 Destroy

 	DestroyComponents

 	Destroying

 	ExecuteAction

 FindComponent

 	FreeNotification

 	FreeOnRelease

 	GetNamePath

 	GetParentComponent

 	HasParent

 	InsertComponent

 	RemoveComponent

 	SafeCallException

Derived from TPersistant

 Assign

Derived from TObject

 	AfterConstruction

 	ClassInfo

 ClassName

 	ClassNameIs

 	ClassParent

 	ClassType

 	CleanupInstance

 	DefaultHandler

 	Dispatch

 	FieldAddress

 	Free

 	FreeInstance

 	GetInterface

 	GetInterfaceEntry

 	GetInterfaceTable

 	InheritsFrom

 	InitInstance

 	InstanceSize

 	MethodAddress

 	MethodName

 	NewInstance


TWhatsThis_Events
TWhatsThis events

TWhatsthis	Legend

In TWhatsThis

OnEnterContextMode

OnF1Keydown

OnGetContext

OnHelp

OnLeaveContextMode

OnPopup


TWhatsThis_OnGetContext_Sample
Example for TWhatsThis.OnGetContext event

The following example assigns help context numbers for standard buttons by analyzing the button caption.

procedure TForm1.WhatsThisGetContext(Sender, HelpItem: TObject; IsMenu: Boolean; var HContext: THelpContext);

   {The CheckCaption function gets the button caption without '&'}

   function CheckCaption(str: string): string;

   var

      I: integer;

   begin

      result := '';

      for I := 1 to length(str) do

        case str[I] of

        '&': if (I < length(str)) and (str[I+1] = '&') then result := result + str[I];

        else result := result + str[I];

        end;

   end;

var

   C: string;

begin

     if (HelpItem is TButton) then

     begin

          C := CheckCaption(TButton(HelpItem).caption);

          if C = 'OK'     then HContext := 100002;

          if C = 'Cancel' then HContext := 100003;

          if C = 'Close'  then HContext := 100004;

          if C = 'Help'   then HContext := 100005;

          if C = 'Apply'  then HContext := 100006;

     end;

end;


THelpContextMap_Properties
THelpContextMap properties

THelpContextMap	Legend

In THelpContextMap

FileName

Derived from TComponent

 	ComObject

ComponentCount

 	ComponentIndex

Components

ComponentState

ComponentStyle

Name

 DesignInfo

Owner

Tag

 VCLComObject


THelpContextMap_Methods
THelpContextMap methods

THelpContextMap	Legend

In THelpContextMap

 	GetContext

Derived from TComponent

 	BeforeDestruction

 	Destroy

 	DestroyComponents

 	Destroying

 	ExecuteAction

 	FindComponent

 	FreeNotification

 	FreeOnRelease

 	GetNamePath

 	GetParentComponent

 	HasParent

 	InsertComponent

 	RemoveComponent

 	SafeCallException

Derived from TPersistant

 	Assign

Derived from TObject

 	AfterConstruction

 	ClassInfo

 	ClassName

 	ClassNameIs

 	ClassParent

 	ClassType

 	CleanupInstance

 	DefaultHandler

 	Dispatch

 	FieldAddress

 	Free

 	FreeInstance

 	GetInterface

 	GetInterfaceEntry

 	GetInterfaceTable

 	InheritsFrom

 	InitInstance

 	InstanceSize

 	MethodAddress

 	MethodName

 	NewInstance


THelpRouter_Properties
THelpRouter properties

THelpRouter	Legend

In THelpRouter

CHMPopupTopics

HelpFile

HelpType

HTMLHelpInstalled

ShowType

Derived from TComponent

ComObject

ComponentCount

 	ComponentIndex

Components

  ComponentState

ComponentStyle

Name

 	DesignInfo

Owner

Tag

 VCLComObject


THelpRouter_Methods
THelpRouter methods

THelpRouter	Legend

In THelpRouter

 	HelpALink

 	HelpContent

 	HelpJump

 	HelpKeyword

 	HelpKLink

 	HelpPopup

Derived from TComponent

 	BeforeDestruction

 	Destroy

 	DestroyComponents

 	Destroying

 	ExecuteAction

 	FindComponent

 	FreeNotification

 	FreeOnRelease

 	GetNamePath

 GetParentComponent

 HasParent

 InsertComponent

 RemoveComponent

 SafeCallException

Derived from TPersistant

 Assign

Derived from TObject

 	AfterConstruction

 	ClassInfo

 	ClassName

 	ClassNameIs

 	ClassParent

 	ClassType

 	CleanupInstance

 	DefaultHandler

 	Dispatch

 	FieldAddress

 	Free

 	FreeInstance

 	GetInterface

 	GetInterfaceEntry

 	GetInterfaceTable

 	InheritsFrom

 	InitInstance

 	InstanceSize

 	MethodAddress

 	MethodName

 	NewInstance


THelpRouter_Events
THelpRouter events

THelpRouter	Legend

In THelpRouter

OnHelp